import java.io.BufferedReader;
import java.io.IOException;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws IOException {
        String fileName = "code.txt";
        WordAnalysis analysis = new WordAnalysis(fileName);
        WordAnalysis.WordInfo wordInfo = analysis.GETSYM();
        while(!wordInfo.getSYM().equals("END")){
            if(wordInfo.getSYM().equals("ERROR")){
                System.out.println("ERROR : in char at " + wordInfo.getNUM());
                break;
            }
            System.out.println(wordInfo);
            wordInfo = analysis.GETSYM();
        }
    }
}
